package com.transfiguro;

import com.transfiguro.converters.JDispatcher;
import com.transfiguro.datamodel.csmodels.CSClassModel;
import com.transfiguro.datamodel.javamodels.ClassModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This class is the entry point for the conversion process
 */
public class Converter {
    private final Logger logger = LoggerFactory.getLogger(Converter.class);
    private JDispatcher dispatcher;
    private CSClassModel csClassModel;

    /**
     * Constructor
     */
    public Converter() {
        dispatcher = new JDispatcher();
    }

    /**
     * This method calls the dispatcher to begin the conversion process
     *
     * @param model The <code>ClassModel</code> to be converted
     */
    public void convertToCS(final ClassModel model) {
        csClassModel = dispatcher.dispatch(model);
    }


    /**
     * Getter for <code>csClassModel</code>
     *
     * @return The <code>csClassModel</code> resulting from the conversion of
     *         the given <code>ClassModel</code>
     */
    public CSClassModel getCsClassModel() {
        return csClassModel;
    }
}
